package cn.cloud.project.consumer.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Swagger OpenAPI 傻傻分不清楚：https://juejin.cn/post/7416660926633803827
 * Knife4j 基础（OpenAPI3+SpringBoot2.7）: https://blog.csdn.net/sgx1825192/article/details/132866723
 * Swagger2: https://blog.csdn.net/xhmico/article/details/131701790
 * OpenAPI 3: https://juejin.cn/post/7345070627107504180
 * 如果报错：https://juejin.cn/post/7360879591236485154
 */
@Configuration
public class Knife4jConfiguration {

    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("Knife4j示例项目 - 接口文档")
                        .description("项目简介，支持Markdown格式：`这里是代码标签哦`，**这里是强调哦**")
                        .version("V1.0")
                        .contact(new Contact().name("ccc"))
                );
    }

}
